//权限钩子
import { useSysStore } from "@/store/sys";
export function usePowerHooks(list: string[]) {
  //获取角色的所有按钮权限
  const { bottonPower } = toRefs(useSysStore());

  //获取当前页面的权限数据
  const power = reactive<any>({});
  list.forEach((v) => {
    let separate = v.includes(":") ? ":" : "."; //获取分隔符号
    let name = v.split(separate);
    power[name[1]] = bottonPower.value?.includes(v);
  });

  console.log("权限", power);

  return {
    power
  };
}
